package sjms.construction.flyweight;

import java.util.HashMap;

/**
 * @ClassName:
 * @Description:
 * @Author fcb
 * @Date 2020/6/3 23:06
 */
public class FlyweightFactory {

    private static final HashMap<String,Shape> map = new HashMap<>();

    public static Shape getShape(String color){
        Circle circle = (Circle)map.get(color);
        if(circle == null){
            circle = new Circle(color);
            map.put(color,circle);
        }
        return circle;
    }
}
